﻿using Cofe.Core.Interfaces;
using Cofe.Core.Property;
using Cofe.Core.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core
{
    public static class IPathParseBehaviorManagerExtension
    {
        //public static async Task<IPropertyHost> TryParsePathAsync(this IPathParseBehaviorManager manager, string fullParsePath, ParsableType type,
        //    EntryConstructionFlags flags = EntryConstructionFlags.Default)
        //{
        //    if (type == ParsableType.AutoDetect)
        //        type = PathUtils.DetectParseType(fullParsePath);

        //    foreach (var p in manager.PathParserManager.PathParsers)
        //        if (p.SupportedParseType.HasFlag(type))
        //        {
        //            var retVal = await p.TryParsePathAsync(fullParsePath, type, flags);
        //            if (retVal != null)
        //                return retVal;
        //        }
        //    return null;
        //}


        //public static IPropertyHost TryParsePath(this IPathParseBehaviorManager manager, string fullParsePath, ParsableType type,
        //    EntryConstructionFlags flags = EntryConstructionFlags.Default)
        //{
        //    return Task.Run(async () => await manager.TryParsePathAsync(fullParsePath, type, flags)).Result.Properties;
        //}

    }
}
